class Dog{
    public String name;
    public String color;
    public int age;

    public void barks(){
        System.out.println(name + " 汪汪汪~~~");
    }
    public void wags(){
        System.out.println(name + " 摇尾巴~~~");
    }
    public void show(){
        System.out.println("姓名： "+name+" 颜色： "+color+" 年龄："+age);
    }
}
class Date{
    public int year;
    public int month;
    public int day;

//    这样写是正常的但要是 形参名不小心与成员变量名相同
//    再加上this看看
    public void setDate(int year,int month,int day){
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public void print(){
        System.out.println(this.year+"/"+this.month+"/"+this.day);
    }
}
public class TestDemo {
    public static void main1(String[] args) {
        Dog dogh = new Dog();
        dogh.name = "小黄";
        dogh.color = "黄色";
        dogh.age = 2;
        dogh.barks();
        dogh.wags();
        dogh.show();
        Dog dogs = new Dog();
        dogs.name = "小黑";
        dogs.color = "黑色";
        dogs.age = 3;
        dogs.barks();
        dogs.wags();
        dogs.show();
    }

    public static void main(String[] args) {
        Date date = new Date();
        date.setDate(2020,5,11);
        date.print();
        Date date1 = new Date();
        date1.setDate(2021,5,11);
        date1.print();
        Date date2 = new Date();
        date2.setDate(2022,5,11);
        date2.print();
    }
}